import request from "@/utils/request";

//添加环境
export function addEnv(data) {
    return request({
        url: '/env/create',
        method: 'post',
        data: data
    })

}

//获取环境信息
export function getEnv(projectId, name, id, pageIndex, pageSize) {
    return request({
        url: '/env/list',
        method: 'get',
        params: {
            projectId,
            name,
            id,
            pageIndex,
            pageSize
        }

    })
}


//删除环境
export function deleteEnv(id) {
    return request({
        url: `/env/delete/${id}`,
        method: 'delete',
    })

}

//更新环境
export function updateEnv(data) {
    return request({
        url: '/env/update',
        method: 'post',
        data: data
    })

}